package com.jkxt.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jkxt.dao.UsersMapper;
import com.jkxt.model.Users;
import com.jkxt.service.IUsersService;

@Service("IUsersService")
public class UsersServiceImpl implements IUsersService {
	
     private UsersMapper usersMapper;

	public UsersMapper getUsersMapper() {
		return usersMapper;
	}
    @Autowired
	public void setUsersMapper(UsersMapper usersMapper) {
		this.usersMapper = usersMapper;
	}
    
    /**
     * 根据用户名查询密码  LZ
     * @return
     */
    public Users selectByNameService(String name){
    	return usersMapper.selectByName(name);
    } 
    
    /**
     * 根据主键查询详情 LZ
     * @param id
     * @return
     */
    public Users selectByPrimaryKeyService(Integer id){
    	return usersMapper.selectByPrimaryKey(id);
    }
    
    /**
     * 根据用户ID查询个人信息  LZ
     * @param id
     * @return
     */
    public Users selectByIdService(Integer id){
    	return usersMapper.selectByPrimaryKey(id);
    }
    
    /**
     * 修改个人信息  LZ
     * @param user
     * @return
     */
    public int updateUserByIdService(Users user){
    	return usersMapper.updateByPrimaryKeySelective(user);
    }
    
    /**
     * 注册用户  LZ
     */
    public int saveUserService(Users user){
      return usersMapper.insertSelective(user);	
    }
    
    

}
